#! /usr/bin/python

import math

def isPrime(n):
    if n == 2 or n==3 or n==5 or n==7:return 1
    if n==1 or n%2 == 0 or n%3==0: return 0
    i = 5
    for i in range(5, int(math.sqrt(n)+1), 6):
	if n%i==0 or n%(i+2)==0:return 0
    return 1

limit = 100
primes = [2]
for p in range(1, limit, 2):
    if isPrime(p): primes.append(p)

def count(N, m, pr):
    if N == 0: return 1
    if N<0: return 0
    if m<=0 and N>=1: return 0
    t = list(pr)
    t.pop()
    return count(N, m-1, t)+count(N-pr[m-1], m, pr)

print count(71, len(primes), primes)
for i in range(11, 100):
    if count(i, len(primes), primes)>5000:
	print i
	break

